package nix.filter;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;



public class AFilter implements Filter {

	@Override
	public void init(FilterConfig fConfig) throws ServletException {
		System.out.println("A Filter init...");
	}

	@Override
	public void doFilter(ServletRequest request, ServletResponse response,
			FilterChain chain) throws IOException, ServletException {
		System.out.println("A Filter doFitler begin...");
		// 放行：相当于调用请求资源
		chain.doFilter(request, response);
		System.out.println("A Filter doFitler end...");
	}

	@Override
	public void destroy() {
		System.out.println("A Filter destory...");
	}

}
